package com.itheima.stock;

import com.itheima.stock.utils.DateTimeUtil;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

import java.time.LocalDateTime;

import java.util.Date;

public class Main {
    public static void main(String[] args) {
//        // 获取当前时间
//        DateTime now = DateTime.now();
//
//        // 定义日期时间格式器
//        DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
//
//        // 格式化并打印当前时间
//        System.out.println("Current time: " + formatter.print(now));
        Date lastDate1 = DateTime.now().toDate();
        Date lastDate = DateTime.now().toDate();
        lastDate=DateTime.parse("2021-12-21 14:30:00", DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss")).toDate();
        System.out.println(lastDate);
        System.out.println(lastDate1);
    }
}